<template>
  <div>
    <el-card>
      <div class="box">
        <img :src="userStore.avatar" alt="" class="avatar" />
        <div class="bottom">
          <h3 class="title">{{ getTime() }}好--{{ userStore.username }}</h3>
          <p class="subtitle">{{ setting.title }}</p>
        </div>
      </div>
    </el-card>
    <svg-icon
      name="welcome"
      width="600px"
      height="600px"
      class="welcome"
    ></svg-icon>
  </div>
</template>

<script setup lang="ts">
// 引入仓库相关的仓库
import useUserStore from '@/store/modules/user'
import { getTime } from '@/utils/time'
import setting from '@/setting'
// 获取存储用户信息的仓库对象
let userStore = useUserStore()
</script>

<style scoped lang="scss">
.box {
  display: flex;
  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  .bottom {
    margin-left: 20px;
    .title {
      font-size: 24px;
      font-weight: 700;
      margin-bottom: 20px;
    }
    .subtitle {
      font-style: italic;
      color: #333;
    }
  }
}
.welcome {
  position: relative;
  left: 25%;
}
</style>
